/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author duongnv
 */
@Entity
@SequenceGenerator(name="seq_conf_rate", initialValue=1, allocationSize=1)
@Table(name = "TBL_CONF_RATE", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TblConfRate.findAll", query = "SELECT t FROM TblConfRate t"),
    @NamedQuery(name = "TblConfRate.findById", query = "SELECT t FROM TblConfRate t WHERE t.id = :id"),
    @NamedQuery(name = "TblConfRate.findByBottomValue", query = "SELECT t FROM TblConfRate t WHERE t.bottomValue = :bottomValue"),
    @NamedQuery(name = "TblConfRate.findByUpValue", query = "SELECT t FROM TblConfRate t WHERE t.upValue = :upValue"),
    @NamedQuery(name = "TblConfRate.findByLevelId", query = "SELECT t FROM TblConfRate t WHERE t.levelId = :levelId"),
    @NamedQuery(name = "TblConfRate.findByRate", query = "SELECT t FROM TblConfRate t WHERE t.rate = :rate")})
public class TblConfRate implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="seq_conf_rate")
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private BigDecimal id;
    @Column(name = "BOTTOM_VALUE")
    private Integer bottomValue;
    @Column(name = "UP_VALUE")
    private Integer upValue;
    @Column(name = "LEVEL_ID")
    private Integer levelId;
    @Column(name = "RATE")
    private Double rate;

    public TblConfRate() {
    }

    public TblConfRate(BigDecimal id) {
        this.id = id;
    }

    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    public Integer getBottomValue() {
        return bottomValue;
    }

    public void setBottomValue(Integer bottomValue) {
        this.bottomValue = bottomValue;
    }

    public Integer getUpValue() {
        return upValue;
    }

    public void setUpValue(Integer upValue) {
        this.upValue = upValue;
    }

    public Integer getLevelId() {
        return levelId;
    }

    public void setLevelId(Integer levelId) {
        this.levelId = levelId;
    }

    public Double getRate() {
        return rate;
    }

    public void setRate(Double rate) {
        this.rate = rate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TblConfRate)) {
            return false;
        }
        TblConfRate other = (TblConfRate) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.TblConfRate[ id=" + id + " ]";
    }
    
}
